package com.manli.api.pojo;

import lombok.Data;
import org.joda.time.DateTime;
import org.joda.time.Days;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;

import java.util.Date;

@Data
public class LocationPoint {
    /**
     * 纬度
     */
    public Double latitude;
    /**
     * 经度
     */
    public Double longitude;

    public LocationPoint(Double longitude,Double latitude) {
        this.latitude = latitude;
        this.longitude = longitude;
    }

    public static void main(String[] args) {
        DateTimeFormatter fmt = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss");
        //2018-11-29
        DateTime dateTime = DateTime.parse("2020-12-21 23:22:45", fmt);
        System.out.println(dateTime.toString("yyyy-MM-dd"));

        //DateTime submitDate = new DateTime(dateStr);
        DateTime nowDate = new DateTime();
        int days= Days.daysBetween(dateTime, nowDate).getDays();
        System.out.println(days);
        System.out.println(new Date().toString());
    }

}
